package com.game.backend.controller.user.account;

import com.game.backend.common.ResponseEntity;
import com.game.backend.entity.AuthTokenResponse;
import com.game.backend.service.user.account.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/user/account")
public class LoginController {
    @Autowired
    private LoginService loginService;

    @RequestMapping("/token")
    public ResponseEntity getToken(String username, String password){
        AuthTokenResponse token = loginService.getToken(username, password);
        return ResponseEntity.ok(token);
    }
}
